package com.qkm.xinguan.controller;

import com.qkm.xinguan.domain.entity.Comment;
import com.qkm.xinguan.response.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author zfj
 * @date 2021/12/29 -15:42
 */
@RequestMapping("/business/comment")
@Api(value = "评论接口模块", tags = "评论接口")
public interface ICommentController {

	@PostMapping("/add")
	@ApiOperation(value = "添加评论信息", notes = "房屋评论添加")
	Result addComment(@RequestBody @Validated Comment comment, BindingResult result);

	@GetMapping("/list/{id}/{page}/{size}")
	@ApiOperation(value = "更具房屋id获取评论信息", notes = "分页评论")
	Result getCommentListPage(@PathVariable("id") String id,@PathVariable(value = "page") int page,
	                          @PathVariable(value = "size") int size);

	@GetMapping("/likenum/{id}")
	@ApiOperation(value = "点赞", notes = "点赞")
	Result updateCommentLikeNum(@PathVariable String id);

	@GetMapping("/likenum/reply/{id}")
	@ApiOperation(value = "回复", notes = "回复")
	Result updateCommentReplyNum(@PathVariable String id);
}
